function throttle(callback, duration = 1000){
    let latTime = 0;

    return function(){
        const now = new Date().getTime()

        if(now - latTime >= duration){
            callback.call(this, ...arguments)
        }

        latTime = now
    }
}



 function getDataSet(event,target){
    return event.currentTarget.dataset[target]
 }
 

 function getEventParams(event,target){
     return event.detail[target]
 }
 
 export {throttle,getDataSet,getEventParams}